package dongchel.vrp.immunes;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import dongchel.vrp.entity.Solution;
import dongchel.vrp.general.CompareObject;
import dongchel.vrp.general.MultiObjectiveComparator;

public class SortPopulation {
	private List<Solution> population;	
	private List<CompareObject> compareObjectList = new ArrayList<CompareObject>();

	
	public SortPopulation(List<Solution> population) {
		this.population = population;
		
	}
	
	public void sortPopulation(){

		for(int i=0;i<population.size();i++){
			CompareObject compareObject = new CompareObject();
			compareObject.setObject(population.get(i));
			compareObject.setValue(population.get(i).getObjectiveValue());
			compareObjectList.add(compareObject);
		}
			
		Collections.sort(compareObjectList,new MultiObjectiveComparator());
	}

	public List<CompareObject> getCompareObjectList() {
		return compareObjectList;
	}

	public void setCompareObjectList(List<CompareObject> compareObjectList) {
		this.compareObjectList = compareObjectList;
	}
	

}
